<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="姓名" id="i1">
<input type="text" placeholder="工资" id="i2">
<input type="text" placeholder="工作" id="i3">
<input type="button" value="添加" onclick="f()">
<table border="1">
  <caption>员工列表</caption>
  <tr>
    <th>姓名</th><th>工资</th><th>工作</th>
  </tr>
  <script>
    function f() {
      // let i1 = document.querySelector("#i1")
      // let i2 = document.querySelector("#i2")
      // let i3 = document.querySelector("#i3")
      let tb = document.querySelector("table")

      let tr = document.createElement("tr")
      let td1 = document.createElement("td")
      let td2 = document.createElement("td")
      let td3 = document.createElement("td")
      td1.innerText=i1.value
      td2.innerText=i2.value
      td3.innerText=i3.value
      tr.append(td1,td2,td3)
      tb.append(tr)
    }
  </script>
</table>
</body>
</html>